#ifndef __TEXTCLASSIFIER_H_
#define __TEXTCLASSIFIER_H_
#include "KLib.h"
#include "NeuralNet.h"
SK

typedef enum _WordClass
{
    WORD_UNKNOWN=0,
    WORD_CONDITION,             //if, when etc..
    WORD_CONJUNCTION,           //and, but
    WORD_NOUN,                  //dog cat
    WORD_VERB,                  //activate, connect
    WORD_DEFINITEARTICLE,       //the
    WORD_INDEFINITEARTICLE      //a, an
}WordClass;

typedef struct _TokenInfo
{
    u32 id;
    WordClass type;
}TokenInfo;

class TextClassifier
{
private:
    typedef std::map <String, u32>Lexicon;
    Lexicon lex;
    NeuralNet *textNet;

	u32 getLexID (const String& word);
    
public:
    TextClassifier ();
    ~TextClassifier ();

    void readTrainingDocument (const String& path, u32 iterations);
	void loadLexicon (const String& filePath);
    void saveLexicon (const String& filePath);

	WordClass classify (const String& word,const String& previousWord, const String& nextWord, u32 sentencePos);
};

EK

#endif